home *** CD-ROM | disk | FTP | other *** search
/ The Epic Collection 3 / Epic Collection 3, The (1997)(Epic Marketing)[!].iso / applications / amigabase / arexx / dial.rexx next >
OS/2 REXX Batch file  |  1996-09-08  |  1KB  |  52 lines

  1. /* Program to dial the phone number of a given person. */
  2.  
  3. /* Make sure AB is running. */
  4. if ~show(PORTS, 'AB_AREXX') then do
  5.     say 'AB is not currently running!  Please start it and try again.'
  6.     exit
  7.     end
  8.  
  9. address 'AB_AREXX'
  10.  
  11. options results
  12.  
  13. /* Ask for and get the name. */
  14. say 'Enter name ?'
  15. parse pull NAME$
  16. FOUND = 0;
  17.  
  18. /* Go to the first entry. */
  19. 'FIRST_ENTRY'
  20.  
  21. /* Start the search going. */
  22. 'SEARCH 1 'NAME$
  23. FINISHED$ = RESULT
  24.  
  25. /* Continue until we have reached the end of the search. */
  26. do while RC = 0 & FINISHED$ ~= 'Not found'
  27.  
  28.     /* If the search matches, then ask if he wants the number dialed.  If he
  29.      * does, then dial it. */ 
  30.     'GET_ENTRY_DETAILS 1'
  31.     say 'Dial 'RESULT' [Y/N] ?'
  32.     pull Y_OR_N$
  33.     if Y_OR_N$ = 'Y' then do
  34.         'DIAL_ENTRY'
  35.         if RC ~= 0 then do
  36.             say 'Unable to dial.'
  37.             end
  38.         end
  39.         FOUND = 1
  40.  
  41.         /* Search for more matches. */
  42.         'SEARCH_AGAIN'
  43.         FINISHED$ = RESULT
  44.     end
  45.  
  46. /* Print up a message if no matches were found. */
  47. if FOUND ~= 1 then do
  48.     say NAME$' was not found!'
  49.     end
  50.  
  51. exit
  52.